<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="id" label="id" width="180"> </el-table-column>
    <el-table-column prop="avatar" label="头像" width="180">
      <template slot-scope="scope">
        <div>
          <el-avatar
            shape="square"
            :size="50"
            :src="scope.row.avatar"
          ></el-avatar>
        </div>
      </template>
    </el-table-column>
    <el-table-column prop="name" label="姓名" width="180"> </el-table-column>
    <el-table-column prop="password" label="密码"> </el-table-column>
    <el-table-column prop="lv" label="等级"> </el-table-column>
  </el-table>
</template>

<script>
import { getuserlist } from '../../api/user.js';
export default {
  name: 'user',
  data() {
    return {
      tableData: [
        {
          id: 3,
          name: '俊涛',
          password: 'asd',
          payimg: null,
          status: 0,
          avatar: 'http://127.0.0.1:3200/img/md.jpg',
          lv: 0,
        },
        {
          id: 4,
          name: '小龙',
          password: 'd7c0bb84d9ab7b0683cac8d15a364d86',
          payimg: null,
          status: 0,
          avatar: 'http://127.0.0.1:3200/img/md.jpg',
          lv: 0,
        },
      ],
    };
  },
  async created() {
    let result = await getuserlist();
    //  发送请求 获取数据库中的用户数据
  },
};
</script>
